'''
Created on 05.08.2011

@author: osman
'''

from pets_ontology import Pets, Pet, Cat, Dog
from people_ontology import Person

# define new predicate for pets:
@Pets.atomic
def hasOwner(pet: Pet, owner: Person) -> 'has owner':
    return True

with Pets:
    # instantiate some pets:
    Tiger = Cat("Tiger")
    Oscar = Cat("Oscar")
    Max = Dog("Max")
    # and persons:
    Robert = Person("Robert")
    
    # add correct predicate
    hasOwner(Tiger, Robert)
    hasOwner(pet = Oscar, owner = Robert)

# printout Pets graph
for arc in Pets.graph: print(arc)

with Pets:
    # add incorrect predicate
    hasOwner(Tiger, Max)